Skip to content

[TypeDeclarationDocblocks] Handle with string key on AddReturnDocblockForCommonObjectDenominatorRector#7256

Merged
samsonasik merged 3 commits intomainfrom
string-key
Sep 12, 2025
Merged

[TypeDeclarationDocblocks] Handle with string key on AddReturnDocblockForCommonObjectDenominatorRector#7256
samsonasik merged 3 commits intomainfrom
string-key

Conversation

@samsonasik
Copy link
Member

Given the following code:

final class WithStringKey
{
    public function getExtensions(): array
    {
        return [
            'a' => new FirstExtension(),
            'b' => new SecondExtension()
        ];
    }
}

currently got docblock:

+    /**
+     * @return \Rector\Tests\TypeDeclarationDocblocks\Rector\ClassMethod\AddReturnDocblockForCommonObjectDenominatorRector\Source\Contract\ExtensionInterface[]
+     */
     public function getExtensions(): array

which should use @return array<string, \Rector\Tests\TypeDeclarationDocblocks\Rector\ClassMethod\AddReturnDocblockForCommonObjectDenominatorRector\Source\Contract\ExtensionInterface>

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @TomasVotruba

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik enabled auto-merge (squash) September 12, 2025 13:31
@samsonasik samsonasik merged commit 2aec276 into main Sep 12, 2025
49 checks passed
@samsonasik samsonasik deleted the string-key branch September 12, 2025 13:32
@TomasVotruba
Copy link
Member

Awesome 🥳

@github-actions
Copy link
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants